class Queue:
    
    def __init__(self,lens):
        self._lens = lens
        self._data = []

    def push(self,data):
        if len(self._data) == self._lens:
            self.pop()
        self._data.append(data)

    def pop(self):
        return self._data.pop(0)

    def printf(self):
        for i in self._data:
            print(i,end=',')

    def change_len(self,lens):
        self._lens = lens

if __name__ == '__main__':
    q = Queue(3)
    q.push(1)
    q.push(2)
    q.push(1)
    q.push(4)
    q.printf()



    